﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Globalization;

namespace StringFormat
{
    class DateTimeFormat
    {
        static DateTime thisDate = DateTime.Now;
        public static void Show()
        {
            // Format the current date in various ways.
            CultureInfo ciAU = new CultureInfo("en-AU");
            CultureInfo ciUS = new CultureInfo("en-US");
            Console.WriteLine("Standard DateTime Format Specifiers");
            Console.WriteLine(
                "(d) Short date: . . . . . . . {0:d}\n" +
                "(D) Long date:. . . . . . . . {0:D}\n" +
                "(t) Short time: . . . . . . . {0:t}\n" +
                "(T) Long time:. . . . . . . . {0:T}\n" +
                "(f) Full date/short time: . . {0:f}\n" +
                "(F) Full date/long time:. . . {0:F}\n" +
                "(g) General date/short time:. {0:g}\n" +
                "(G) General date/long time: . {0:G}\n" +
                "    (default):. . . . . . . . {0} (default = 'G')\n" +
                "(M) Month:. . . . . . . . . . {0:M}\n" +
                "(R) RFC1123:. . . . . . . . . {0:R}\n" +
                "(s) Sortable: . . . . . . . . {0:s}\n" +
                "(u) Universal sortable: . . . {0:u} (invariant)\n" +
                "(U) Universal full date/time: {0:U}\n" +
                "(Y) Year: . . . . . . . . . . {0:Y}\n"+
                "(yyyy) Year: . . . . . . . . .{0:yyyy}\n" +
                "(yyyy-MM-dd)..................{0:yyyy-MM-dd}\n"
                ,thisDate);
        }
    }
}
